<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.dic.service.WorddictionaryService"%>
<%@ page import="com.dic.dao.*"%>
<%@ page import="com.dic.dao.model.*"%>
<%@ page import="java.text.DateFormat"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%
   request.setCharacterEncoding("UTF-8");
   response.setCharacterEncoding("UTF-8"); 
   
   String chinese=request.getParameter("chinese").trim();
   String ispass=request.getParameter("ispass");
   String renewdate=request.getParameter("renewdate");//可以注释掉，下面没用到
   String advice=request.getParameter("advice");
   
    Date date=new Date();
    DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); 
    //df.format(date); 就变为string了。
   
   HashMap<String,String> hm=new HashMap<String,String>();
   hm.put("chinese", chinese);
   hm.put("ispass", ispass);
   hm.put("renewdate",df.format(date));
   hm.put("advice", advice);
   
   WorddictionaryService ser = new WorddictionaryService();
   int updateflag=ser.updateWordManage(hm);
   
   if(updateflag==1){
       out.print("{'result':'success'}");
   }else{
      out.print("{'result':'fail'}");
   }
  
   
%>